<template>
  <div>
    <div class="header">
      <span>游戏租号列表</span>
      <van-icon name="wap-home" />
    </div>

    <!-- 搜索框 -->
    <form action="/">
      <van-search
        v-model="value"
        show-action
        placeholder="请输入搜索关键词"
        @search="onSearch"
      />
    </form>

    <!-- 轮播 -->
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
      <van-swipe-item>1</van-swipe-item>
      <van-swipe-item>2</van-swipe-item>
    </van-swipe>
  </div>
</template>

<script>
import {rental} from '../api/rental'
export default {
  data() {
    return {
      value: "",
      banner:[],
    };
  },
  methods: {
    onSearch(val) {
      let encode = encodeURIComponent(val);
      console.log(encode);
    },
  },
  created () {  
    rental().then((val) => {
    console.log(1);
    var b = val.data;
    this.banner = b;
    console.log(b);
    });
  },
};
</script>
<style src="../assets/css/rental.css" scoped>
.my-swipe .van-swipe-item {
  color: #fff;
  font-size: 20px;
  line-height: 150px;
  text-align: center;
  background-color: #39a9ed;
}
</style>